package cn.school.educational.service;

import cn.school.educational.entity.HomeWorkInfo;
import cn.school.educational.entity.HomeworkComments;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface HomeWorkInfoService {
    /**
     * 分页查询家庭作业
     * @param entiry
     * @return
     */
    IPage<HomeWorkInfo> pageList(HomeWorkInfo entiry);

    /**
     * 学生查询作业
     * @param entiry
     * @return
     */
    IPage<HomeWorkInfo> studentPageList(HomeWorkInfo entiry);

    /**
     * 新增or修改家庭作业
     * @param entiry
     * @return
     */
    int addOrUpdateHomeWork(HomeWorkInfo entiry);

    /**
     * 删除根据ID
     * @param entiry
     * @return
     */
    int deleteById(HomeWorkInfo entiry);

    /**
     * 根据ID查询详情
     * @param id
     * @return
     */
    HomeWorkInfo workDetails(String id);

    /**
     * 新增评论
     * @param comments
     * @return
     */
    int addComments(HomeworkComments comments);

    /**
     * 根据作业ID查询评论
     * @param workId
     * @return
     */
    List<HomeworkComments> findCommentsDetails(String workId);

    /**
     * 查询回复数据结构
     * @param pid
     * @return
     */
    List<HomeworkComments> findreplyDetails(String pid);

    /**
     * 添加回复
     * @param comments
     * @return
     */
    int addReply(HomeworkComments comments);

    /**
     * 作业文件上传
     * @param file
     * @return
     */
    String homeWorkFileUpload(MultipartFile file) throws IOException;

    Boolean deleteWithComments(String id);
}
